package com.ruoyi.gybj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gybj.mapper.HazardChemicalMapper;
import com.ruoyi.gybj.domain.HazardChemical;
import com.ruoyi.gybj.service.IHazardChemicalService;

/**
 * 重大危险源涉及危化品Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-19
 */
@Service
public class HazardChemicalServiceImpl implements IHazardChemicalService 
{
    @Autowired
    private HazardChemicalMapper hazardChemicalMapper;

    /**
     * 查询重大危险源涉及危化品
     * 
     * @param id 重大危险源涉及危化品主键
     * @return 重大危险源涉及危化品
     */
    @Override
    public HazardChemical selectHazardChemicalById(Long id)
    {
        return hazardChemicalMapper.selectHazardChemicalById(id);
    }

    /**
     * 查询重大危险源涉及危化品列表
     * 
     * @param hazardChemical 重大危险源涉及危化品
     * @return 重大危险源涉及危化品
     */
    @Override
    public List<HazardChemical> selectHazardChemicalList(HazardChemical hazardChemical)
    {
        return hazardChemicalMapper.selectHazardChemicalList(hazardChemical);
    }

    /**
     * 新增重大危险源涉及危化品
     * 
     * @param hazardChemical 重大危险源涉及危化品
     * @return 结果
     */
    @Override
    public int insertHazardChemical(HazardChemical hazardChemical)
    {
        hazardChemical.setCreateTime(DateUtils.getNowDate());
        return hazardChemicalMapper.insertHazardChemical(hazardChemical);
    }

    /**
     * 修改重大危险源涉及危化品
     * 
     * @param hazardChemical 重大危险源涉及危化品
     * @return 结果
     */
    @Override
    public int updateHazardChemical(HazardChemical hazardChemical)
    {
        hazardChemical.setUpdateTime(DateUtils.getNowDate());
        return hazardChemicalMapper.updateHazardChemical(hazardChemical);
    }

    /**
     * 批量删除重大危险源涉及危化品
     * 
     * @param ids 需要删除的重大危险源涉及危化品主键
     * @return 结果
     */
    @Override
    public int deleteHazardChemicalByIds(Long[] ids)
    {
        return hazardChemicalMapper.deleteHazardChemicalByIds(ids);
    }

    /**
     * 删除重大危险源涉及危化品信息
     * 
     * @param id 重大危险源涉及危化品主键
     * @return 结果
     */
    @Override
    public int deleteHazardChemicalById(Long id)
    {
        return hazardChemicalMapper.deleteHazardChemicalById(id);
    }
}
